<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1,user-scalable=0">
<title>无标题文档</title>
<script type="text/javascript" src="../../kq.dev.js?v=1.0.1"></script>
<script type="text/javascript" src="../touch/kq.touch.js?v=1.0.3"></script>
</head>

<body>
<div id="img" style="transition: 0.5s;overflow: hidden;">
	<img id="" src="map.jpg" />
</div>
<script>
var touch = new $Q.plugIn.Touch({
	element:document.getElementById("img")
});
touch.preload();
$Q.debug("start");
var scale = 1;
touch.onZoom = function(evt){
	evt.src;//之前的距离
	evt.dst;//之后的距离
	//如果放大，当前的尺寸除以放大的倍率
	//这个是放大的倍率
	scale = scale * Math.sqrt(Math.sqrt(evt.dst / evt.src));
	//scale = (evt.dst - evt.src/scale ) / (evt.src/scale);
	$Q('#img').css("transform","scale("+scale +")");
	console.log(evt);
	//当前放大的倍率
	$Q.debug(evt,"evt");
	$Q.debug(scale);
}
console.log(touch);
</script>
</body>
</html>
